#!/usr/bin/env bash

test ! -f /sys/class/power_supply/AC/online \
  && notify-send "This ain't no laptop, fool!" \
  && exit 1

(( $(cat /sys/class/power_supply/AC/online) == 1 )) \
  && notify-send 'AC Adapter Connected'

(( $(cat /sys/class/power_supply/AC/online) == 0 )) \
  && notify-send 'AC Adapter Disconnected'